cmake_minimum_required(VERSION 3.12)
project(libevent_udp)
SET(CMAKE_BUILD_TYPE "Debug")
SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb")
SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
set(THREADS_PREFER_PTHREAD_FLAG ON)
set(CMAKE_CXX_STANDARD 14)
file(GLOB to_remove udp_client.cpp)
find_package(Threads)
find_package(Libevent REQUIRED)

aux_source_directory(. DIR_SRCS)
message(${DIR_SRCS})
list(REMOVE_ITEM DIR_SRCS ${to_remove})
add_executable(libevent_udp ${DIR_SRCS})
target_link_libraries(libevent_udp ${CMAKE_THREAD_LIBS_INIT} event)